---
id: 64496df724dd3716a71fe971
title: Schritt 26
challengeType: 0
dashedName: step-26
---

# --description--

Object properties consist of key/value pairs. You can use shorthand property names when declaring an object literal. When using the shorthand property name syntax, the name of the variable becomes the property key and its value the property value.

The following example declares a `user` object with the properties `userId`, `firstName`, and `loggedIn`.

```js
const userId = 1;
const firstName = "John";
const loggedIn = true;

const user = {
  userId,
  firstName,
  loggedIn,
};

console.log(user); // { userId: 1, firstName: 'John', loggedIn: true }
```

Um den Überblick über alle Funktionen deiner Tabelle zu behalten, deklariere ein `spreadsheetFunctions`-Objekt. Using the shorthand notation syntax, set `sum`, `average`, and `median` as properties on the `spreadsheetFunctions` object.

# --hints--

Du solltest eine `spreadsheetFunctions`-Variable deklarieren.

```js
assert.match(code, /(?:const|let|var)\s+spreadsheetFunctions/);
```

Du solltest `const` verwenden, um deine `spreadsheetFunctions`-Variable zu deklarieren.

```js
assert.match(code, /const\s+spreadsheetFunctions/);
```

Deine `spreadsheetFunctions`-Variable sollte ein Objekt sein.

```js
assert.isObject(spreadsheetFunctions);
```

Dein `spreadsheetFunctions`-Objekt sollte eine `sum`-Eigenschaft enthalten.

```js
assert.property(spreadsheetFunctions, "sum");
```

Deine `sum`-Eigenschaft sollte deine `sum`-Funktion sein.

```js
assert.equal(spreadsheetFunctions?.sum, sum);
```

Dein `spreadsheetFunctions`-Objekt sollte eine `average`-Eigenschaft enthalten.

```js
assert.property(spreadsheetFunctions, "average");
```

Deine `average`-Eigenschaft sollte deine `average`-Funktion sein.

```js
assert.equal(spreadsheetFunctions?.average, average);
```

Dein `spreadsheetFunctions`-Objekt sollte eine `median`-Eigenschaft enthalten.

```js
assert.property(spreadsheetFunctions, "median");
```

Deine `median`-Eigenschaft sollte deine `median`-Funktion sein.

```js
assert.equal(spreadsheetFunctions?.median, median);
```

Du solltest die Syntax der Destrukturierung verwenden, um deine Eigenschaften zuzuweisen.

```js
const objectText = code.replace(/.*const\s+spreadsheetFunctions\s*=\s*\{([^}]*)}.*/s, "$1");
assert.include(objectText, "sum");
assert.include(objectText, "average");
assert.include(objectText, "median");
assert.notInclude(objectText, ":");
```

# --seed--

## --seed-contents--

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="./styles.css" />
    <title>Functional Programming Spreadsheet</title>
  </head>
  <body>
    <div id="container">
      <div></div>
    </div>
    <script src="./script.js"></script>
  </body>
</html>
```

```css
#container {
  display: grid;
  grid-template-columns: 50px repeat(10, 200px);
  grid-template-rows: repeat(11, 30px);
}

.label {
  background-color: lightgray;
  text-align: center;
  vertical-align: middle;
  line-height: 30px;
}
```

```js
const isEven = num => num % 2 === 0;
const sum = nums => nums.reduce((acc, el) => acc + el, 0);
const average = nums => sum(nums) / nums.length;

const median = nums => {
  const sorted = nums.slice().sort((a, b) => a - b);
  const length = sorted.length;
  const middle = length / 2 - 1;
  return isEven(length)
    ? average([sorted[middle], sorted[middle + 1]])
    : sorted[Math.ceil(middle)];
}

--fcc-editable-region--

--fcc-editable-region--

const range = (start, end) => Array(end - start + 1).fill(start).map((element, index) => element + index);
const charRange = (start, end) => range(start.charCodeAt(0), end.charCodeAt(0)).map(code => String.fromCharCode(code));

window.onload = () => {
  const container = document.getElementById("container");
  const createLabel = (name) => {
    const label = document.createElement("div");
    label.className = "label";
    label.textContent = name;
    container.appendChild(label);
  }
  const letters = charRange("A", "J");
  letters.forEach(createLabel);
  range(1, 99).forEach(number => {
    createLabel(number);
    letters.forEach(letter => {
      const input = document.createElement("input");
      input.type = "text";
      input.id = letter + number;
      input.ariaLabel = letter + number;
      container.appendChild(input);
    })
  })
}
```
